package Modelo;
import java.util.Iterator;
import java.util.List;

import junit.framework.TestCase;


public class PlanetaTest extends TestCase {

	public void testAgregarPooglin(){
		Planeta planeta = new Planeta("testPlaneta.txt");
		planeta.agregarPooglin();
		// Se agrego un pooglin al planeta, por lo tanto
		// la lista de los pooglins no esta vacia
		assertFalse (planeta.getPooglins().isEmpty());
	}
	
	public void testMatarPooglin(){
		Planeta planeta = new Planeta("testPlaneta.txt");
		planeta.agregarPooglin();
		assertFalse (planeta.getPooglins().isEmpty());
		List<Pooglin> pooglins = planeta.getPooglins();
		Iterator<Pooglin> iterador = pooglins.iterator();
		Pooglin pooglin = null;
		// Obtengo el pooglin del planeta
		if (iterador.hasNext()){
			pooglin = iterador.next();
		}
		pooglin.morir();
		planeta.quitarPooglinsMuertos();
		// Mato al pooglin
		//planeta.matarPooglin(pooglin);
		// No hay mas pooglin en el planeta
		assertTrue (planeta.getPooglins().isEmpty());
	}
}
